package tpju;


public class Rayon
{
    // instance variables - replace the example below with your own
    private String code ;
    private int etage;
    private Magasin m;

    public Rayon(String code, int etage)
    {
        // initialise instance variables
        this.code = code;
        this.etage=etage;
    }
    
    public String getCode(){
        return this.code;
    }
    
    public void setCode(String code){
        this.code=code;
    }
       
    public int getEtage(){
        return this.etage;
    }
    
    public void setEtage(int etage){
        this.etage=etage;
    }
    
    public Magasin getMagasin(){
        return this.m;
    }
    
    public void setMagasin(Magasin m){
        this.m=m;
    }
    
    public void ajouterMagasin(Magasin magasin){ 
        if( magasin != null ) { 
          if( !magasin.getListe().contains(this)){ 
	            if (m != null){
	            	m.supprimer(this);
	            }
            }
            this.setMagasin(magasin);
            m.getListe().add(this);
          }
        }
}


